<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/Notice.css}">
</head>
<body>
    借阅界面
    <div class="choice">
        <a th:href="@{borrow}"><button class="button" style="cursor: pointer">借阅</button></a>
        <a th:href="@{giveBack}"><button class="button" style="cursor: pointer">归还</button></a>
    </div>
    <div class="bookList" th:fragment="bookListWindow" th:id="id_bookListWindow" style="display: block">
        <table border="1" class="list" id="booklist">
            <thead id="listHead">
            <tr>
                <th>bookid</th>
                <th>bookname</th>
                <th>author</th>
                <th>borrowdate</th>
                <th>state</th>
                <th>action</th>
            </tr>
            </thead>
            <tbody id="bookListBody">
            <tr th:each="borrowhistory : ${pageInfo.list}">
                <td th:text="${borrowhistory.borrowbookid}"></td>
                <td th:text="${borrowhistory.borrowbookname}"></td>
                <td th:text="${borrowhistory.bookauthor}"></td>
                <td th:text="${borrowhistory.borrowdate}"></td>
                <td th:text="${borrowhistory.borrowstate}"></td>
                <td>
                    <a th:href="@{giveBackBook(bookid=${borrowhistory.borrowbookid})}">
                        <button class="button1"style="cursor: pointer"/><span>归还</span></button>
                    </a>
                </td>
            </tr>
            </tbody>
        </table>
        <p>
            当前 <span th:text="${pageInfo.pageNum}"></span> 页,
            总 <span th:text="${pageInfo.pages}"></span> 页,
            共<span th:text="${pageInfo.total}"></span> 条记录
        </p>
        <div >
            <br>
            <a th:href="@{giveBack}"><button class="button1" style="cursor: pointer">首頁</button></a>
            <a th:href="@{giveBack(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}"> <button class="button1" style="cursor: pointer">上一页</button></a>
            <a th:href="@{giveBack(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}"><button class="button1" style="cursor: pointer">下一頁</button></a>
            <a th:href="@{giveBack(pageNum=${pageInfo.pages})}"><button class="button1" style="cursor: pointer">末页</button ></a>
            <br>
        </div>
    </div>
</body>
</html>